package com.dyh.quickdemo.depRm;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/*
@Author=Joey Wheeler
@Date=2021/3/26 10:35
*/
public class CommonInvocationHandler implements InvocationHandler {

    //代理类中的真实对象
    private Object target;

    public CommonInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("before invoke。。。");
        Object invoke = method.invoke(target, args);
        System.out.println("after invoke。。。");
        return invoke;
    }
}
